from django.db import models

# Create your models here.


class miniProgram(models.Model):
    """
    小程序和网页
    """
    title = models.CharField(verbose_name="标题",max_length=128)
    cover = models.CharField(verbose_name="封面",max_length=255)
    content = models.TextField(verbose_name='内容',help_text="存储大容量文本")
    create_date = models.DateTimeField(verbose_name='创建时间',auto_now_add=True)
    sketch = models.CharField(verbose_name='简述',max_length=255)
    language = models.CharField(verbose_name='语言',max_length=64)
    type = models.CharField(verbose_name="类型",max_length=64,default="miniProgram")
    address = models.CharField(verbose_name="地址",max_length=255,null=True,blank=True)

    class Meta:
        # managed = False
        db_table = 'mini_program_and_web'






####这个功能先不开########

class ContentDetail(models.Model):
    """
    内容详细
    """
    key = models.CharField(verbose_name='腾讯对象存储中的文件名',max_length=128,help_text="用于以后在腾讯对象存储中删除")
    cos_path = models.CharField(verbose_name="腾讯对象存储中图片路径",max_length=128)
    miniprogram = models.ForeignKey(verbose_name="小程序",to="miniProgram",on_delete=models.CASCADE,null=True)

    class Meta:
        # managed = False
        db_table = 'content_detail'